package com.example.myapplication.entity

import android.os.Parcel
import android.os.Parcelable

class CustomerInfoBean(
    var id: String = "", // 客户ID
    var code: String = "",//客户编号
    var cname: String = "",//客户名称
    var types: String = "",//类别 ID
    var typesname: String = "", //类别名称
    var isused: String? = "",//有效状态  0无效 1有效
    var balance: String? = "", //应收金额 types=1 or type=4  为应收，否则为应付
    var suramt: String? = "", //预收金额 types=1 or type=4  为预收，否则为预付
    var oweamt: String? = "", // 欠款
    var lxrid: String? = "", // 联系人 id
    var lxrname: String? = "", // 联系人
    var phone: String? = "", // 联系电话
    var shipto: String? = "" // 联系地址
) : Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readString() ?: "",
        parcel.readString() ?: "",
        parcel.readString() ?: "",
        parcel.readString() ?: "",
        parcel.readString() ?: "",
        parcel.readString() ?: "",
        parcel.readString() ?: "",
        parcel.readString() ?: "",
        parcel.readString() ?: "",
        parcel.readString() ?: "",
        parcel.readString() ?: "",
        parcel.readString() ?: "",
        parcel.readString() ?: ""
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(id)
        parcel.writeString(code)
        parcel.writeString(cname)
        parcel.writeString(types)
        parcel.writeString(typesname)
        parcel.writeString(isused)
        parcel.writeString(balance)
        parcel.writeString(suramt)
        parcel.writeString(oweamt)
        parcel.writeString(lxrid)
        parcel.writeString(lxrname)
        parcel.writeString(phone)
        parcel.writeString(shipto)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<CustomerInfoBean> {
        override fun createFromParcel(parcel: Parcel): CustomerInfoBean {
            return CustomerInfoBean(parcel)
        }

        override fun newArray(size: Int): Array<CustomerInfoBean?> {
            return arrayOfNulls(size)
        }
    }
}


